package com.one.group.model.dto;

import com.mybatisflex.annotation.Column;
import jakarta.validation.constraints.*;
import lombok.Data;

import java.io.Serializable;
import java.util.Date;

@Data
public class VisitorDto implements Serializable {

    @NotNull
    private String name;

    @Min(value = 0, message = "性别值只能为0或1")
    @Max(value = 1, message = "性别值只能为0或1")
    private Integer sex;

    @Pattern(regexp = "^[1-9]\\d{5}(18|19|20)\\d{2}((0[1-9])|(1[0-2]))(([0-2][1-9])|10|20|30|31)\\d{3}[0-9Xx]$", message = "请正确输入身份证号")
    @Column("card_id")
    private String cardId;

    @NotNull
    private String image;

    @Pattern(regexp = "^1[3-9]\\d{9}$", message = "请正确输入手机号")
    private String phone;

    @Column(value = "cell_id")
    @NotNull(message = "小区ID不能为空")
    @Min(value = 1, message = "小区ID必须大于0")
    private Long cellId;

    @Column(value = "cell_building")
    @NotNull(message = "楼栋ID不能为空")
    private Long cellBuilding;

    @Column(value = "cell_unit")
    @NotNull(message = "单元ID不能为空")
    private Long cellUnit;

    @Column(value = "cell_house")
    @NotNull(message = "房屋ID不能为空")
    private Long cellHouse;

    @Column(value = "tenant_id")
    private Long tenantId;

}